/**
 * 客户端类，用于测试观察者模式
 */
public class Client {
    public static void main(String[] args) {
        // 创建一个具体战队控制中心
        AllyControlCenter acc = new ConcreteAllyControlCenter("张无忌");
        // 创建四个玩家
        Observer player1, player2, player3, player4;
        player1 = new Player("小李");
        player2 = new Player("小王");
        player3 = new Player("小张");
        player4 = new Player("小赵");
        // 玩家加入战队
        acc.join(player1);
        acc.join(player2);
        acc.join(player3);
        acc.join(player4);
        // 玩家1被攻击
        player1.beAttacked(acc);
    }
}